<!doctype html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
    <title>转让或者出借“{{$books->book_name}}”</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="author" content="夜读书">
    <meta name="description" content="夜读书中文网">
    <meta name="keywords" content="读书,阅读,小说,文学">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="{{ asset('/bootstrap-3.3.5-dist/css/bootstrap.min.css') }}">
    <link rel="stylesheet" href="{{ asset('/style/css/yds.css') }}">
    <link rel="stylesheet" href="{{ asset('/style/css/ucenter.css') }}">
    <script src="{{ asset('/scripts/jquery/jquery-1.11.3.min.js') }}"></script>
    <script src="{{ asset('/bootstrap-3.3.5-dist/js/bootstrap.min.js') }}"></script>
</head>
<body>
@include('books.partials.navtop')
@include('books.partials.nav')
<div id="yds_screen">
<div id="yds_content" class="clearfix">
  <div class="review">
    <h1>转让“{{$books->book_name}}”</h1>
    <div class="article">    
    <form name="form" method="post" action="{{url('saveaddbags')}}">
    <div style="display:none;">
        <input type="hidden" name="_token" value="{{ csrf_token() }}" />
        <input type="hidden" name="book_id" value="{{$books->book_id}}" />
        <input type="hidden" name="book_name" value="{{$books->book_name}}" />
        <input type="hidden" name="zuozhe" value="{{$books->zuozhe}}" />
        <input type="hidden" name="isbn" value="{{$books->isbn}}" />
    </div>
      <table align="">
        <tbody><tr>
          <td class="" height="35" align="right" valign="top">我想:</td>
          <td width="20"></td>
          <td>
            <label><input name="otype" value="J" false="" type="radio">借阅</label>
            <label><input name="otype" value="E" false="" type="radio">交换</label>
            <label><input name="otype" value="S" false="" type="radio" checked="checked">出售</label>
            <label><input name="otype" value="Z" false="" type="radio">赠送</label>
            <!-- <label><input name="otype" value="B" type="radio">以上均可</label> -->
            <br><br>
          </td>
        </tr>
        <tr>
          <td class="" height="35" align="right" valign="top">地点:</td>
          <td width="20"></td>
          <td>
            <label><input name="scope" value="L" false="" type="radio">当地(同城)</label>
            <label><input name="scope" value="R" checked="checked" type="radio">当地或异地</label>
            <br><br>
          </td>
        </tr>
        <tr>
          <td class="" height="35" align="right" valign="top">新旧程度:</td>
          <td width="20"></td>
          <td>
            <label>
                <select id="condition" name="condition">
                  <option value="-" selected="selected">--请选择--</option>
                  <option value="10">全新</option>
                  <option value="9">9成新</option>
                  <option value="8">8成新</option>
                  <option value="7">7成新</option>
                  <option value="6">6成新</option>
                  <option value="5">5成新</option>
                  <option value="0">较旧</option>
                </select>
            </label>
            <br><br>
          </td>
        </tr>
<!--         <tr>
          <td class="" align="right" valign="top">原价: </td>
          <td></td>
          <td>
            <input name="price" id="price" size="5" maxlength="10" value="" type="text">元<br><br>
          </td>
        </tr> -->
        <tr>
          <td class="" align="right" valign="top">售价(转让)或估值(交换): </td>
          <td></td>
          <td>
            <input name="nowprice" id="nowprice" size="5" maxlength="10" value="" type="number" onkeyup="if(isNaN(value))execCommand('undo')" onafterpaste="if(isNaN(value))execCommand('undo');">元<br><br>
          </td>
        </tr>
        <tr>
          <td class="" align="right" valign="top">数量: </td>
          <td></td>
          <td>
            <input name="num" id="num" size="5" maxlength="10" value="" type="number" onkeyup="this.value=this.value.replace(/\D/g,'');" onafterpaste="this.value=this.value.replace(/\D/g,'')";><br><br>
          </td>
        </tr>
        <tr>
          <td class="" align="right" valign="top">备注(150字内): </td>
          <td></td>
          <td><textarea name="beizhu" rows="10" cols="45" maxlength="150"></textarea></td>
        </tr>
        <tr>
          <td></td>
          <td></td>
          <td>
            <br>
            <input name="ex_submit" id="ex_submit" value="确定发布" type="button"><span class="ms"></span>
          </td>
        </tr>
      </tbody></table>
    </form>
    </div>
  </div>
  <div class="aside">
  <div class="indent">
  </div>  
  <div class="pl2"><a href="{{url('info')}}/{{$books->book_id}}">{{$books->book_name}}</a></div>
  <div class="rebook">
    <a href="{{url('info')}}/{{$books->book_id}}"><img src="{{url($books->bimg)}}"></img></a>
    <br/>
    @if($books->zuozhe!="") <span class="p1">作者:{{ $books->zuozhe }}</span><br/> @endif
    @if($books->yuanzuoming!="") <span class="p1">原作名:{{ $books->yuanzuoming }}</span><br/> @endif
    @if($books->isbn!="") <span class="p1">isbn:{{ $books->isbn }}</span><br/> @endif
    @if($books->book_name!="") <span class="p1">书名:{{ $books->book_name }}</span><br/> @endif
    @if($books->yeshu!="") <span class="p1">页数:{{ $books->yeshu }}</span><br/> @endif
    @if($books->yizhe!="") <span class="p1">译者:{{ $books->yizhe }}</span><br/> @endif
    @if($books->dingjia!="") <span class="p1">定价:{{ $books->dingjia }}</span><br/> @endif
    @if($books->chubanshe!="") <span class="p1">出版社:{{ $books->chubanshe }}</span><br/> @endif
    @if($books->zhuangzhen!="") <span class="p1">装帧:{{ $books->zhuangzhen }}</span><br/> @endif
    @if($books->chubannian!="") <span class="p1">出版年:{{ $books->chubannian }}</span><br/> @endif
  </div>
  </div>
</div>
</div>
<script>
$(document).ready(function(){
    $("#ex_submit").click(function(){
        if($.trim($("#condition").val())=="-")
        {
            $(".ms").html("<font color='red'>请选择新旧程度。</font>");
            $("#condition").focus();
        }
        else if($.trim($("#nowprice").val())==""){
          $(".ms").html("<font color='red'>请输入正确的销售价格。</font>");
            $("#nowprice").focus();
        }
        else if($.trim($("#nowprice").val()) < 0){
          $(".ms").html("<font color='red'>销售价格不能小于0。</font>");
            $("#nowprice").focus();
        }
        else if($.trim($("#num").val())==""){
          $(".ms").html("<font color='red'>请输入出售数量。</font>");
            $("#num").focus();
        }
        else if($.trim($("#num").val())  < 0){
          $(".ms").html("<font color='red'>出售数量不能小于0。</font>");
            $("#num").focus();
        }
        else
        {
            form.submit();
        }
    });
});
</script>
@include('books.partials.footer')
</body>
</html>
